import Vue from "vue";
import VueRouter from "vue-router";


Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    component: () => import('@/views/Layout'),
    meta:{title:'首页'},
    children: [
      {
        path: '',
        component: () => import('@/views/Index'),
        meta:{title:'欢迎'},
      },
      {
        path: '/goods/list',
        component: () => import('@/views/Goods/list'),
        meta:{title:'商品列表'},
      },
      {
        path: '/goods/params',
        component: () => import('@/views/Goods/params'),
        meta:{title:'商品参数'},
      },
      {
        path: '/goods/cate',
        component: () => import('@/views/Goods/cate'),
        meta:{title:'商品分类'},
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/Login')
  },
  {
    path: '*',
    component: () => import('@/views/Error')
  }
];

const router = new VueRouter({
  routes,
});

export default router;
